package com.theexceptions.todo.view;

import com.theexceptions.todo.controller.HomeController;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class HomeActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.home);
	}

	/**
	 * Switches the layout from the home screen to add task screen when the
	 * "plus" is clicked
	 * 
	 * @param view
	 */
	public void addtaskButtonClicked(View view) {
		Intent intent = new Intent(view.getContext(), AddTaskActivity.class);
		startActivityForResult(intent, 0); // TODO change 0 to meaningful code
	}

	/**
	 * Switches the layout from the home screen back to the login screen when
	 * "logout" is clicked
	 * 
	 * @param view
	 */
	public void logoutButtonClicked(View view) {
		HomeController.logout();
		finish();
	}
	
	public void taskListButtonClicked(View view) {
		Intent intent = new Intent(view.getContext(), TaskFilterActivity.class);
		startActivityForResult(intent,0); // TODO change 0 to meaningful code
	}
	
	public void mapButtonClicked(View view) {
		Intent intent = new Intent(view.getContext(), ShowMapActivity.class);
		startActivityForResult(intent,0);
	}
}
